<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>user</title>
		<%@ include file="/common/meta.jsp"%>
		<s:head theme="ajax" />
	</head>

	<body>
		<s:include value="/common/content_title.jsp">
			<s:param name="title">系统人员管理</s:param>
		</s:include>

		<div id="content-data">

			<div class="search-wrapper">
				<table class="detail-list">
					<tr>
						<td class="detail-title" colspan="4">
							<span class="table-title">搜索</span>
						</td>
					</tr>
					<tr>
						<td class="label-cell">
							查询关键字
						</td>
						<td class="data-cell" colspan="2">
							<s:textfield name="searchKey" cssClass="long-input-text"></s:textfield>
						</td>
					</tr>
				</table>
				<div class="search-btn">
					<s:submit value="搜索"></s:submit>
				</div>
			</div>

			<div class="detail-list-wrapper">

				<table class="detail-list" border="1">
					<tr>
						<th>
							序号
						</th>
						<th>
							帐号
						</th>
						<th>
							密码
						</th>
						<th>
							注册邮箱
						</th>
						<th>
							激活
						</th>
						<th colspan="3" align="center">
							操作
						</th>
					</tr>

					<s:if
						test="userPage==null || userPage.records==null || userPage.records.isEmpty()">
						<tr>
							<td colspan="8" align="center">
								<font color="red">没找到相应记录</font>
							</td>
						</tr>
					</s:if>
					<s:else>
						<s:iterator id="ent" status="st" value="userPage.records">
							<tr>
								<td>
									<s:property value="#st.index + 1" />
								</td>
								<td>
									<s:property value="#ent.account" />
								</td>
								<td>
									<s:property value="#ent.passwd" />
								</td>
								<td>
									<s:property value="#ent.email" />
								</td>
								<s:if test="#ent.enable == true">
									<td>
										是
									</td>
								</s:if>
								<s:else>
									<td>
										否
									</td>
								</s:else>
								<td>
									<a href="<s:url action="queryDetailAction" namespace="/user">
									<s:param name="userAccount" value="#ent.account"></s:param>
									</s:url>">详情</a>
								</td>
								<td>
									<a href="<s:url action="queryDetailAction" namespace="/user">
									<s:param name="userAccount" value="#ent.account"></s:param>
									<s:param name="action" value="%{'query_for_update'}"></s:param>
									</s:url>">修改</a>
								</td>
								<td>
									<a href="<s:url action="deleteAction" namespace="/user">
									<s:param name="id" value="#ent.id"></s:param>
									</s:url>">删除</a>
								</td>
							</tr>
						</s:iterator>
					</s:else>
				</table>

				<div align="center">
					<pg:pager items="${userPage.total}" maxIndexPages="10"
						maxPageItems="4" url="queryListAction.action"
						export="currentPageNumber=pageNumber">
						<pg:first>
							<a href="${pageUrl}">[首页]</a>
						</pg:first>
						<pg:prev>
							<a href="${pageUrl}">前一页</a>
						</pg:prev>
						<pg:pages>
							<c:choose>
								<c:when test="${currentPageNumber eq pageNumber}">
									<font color="red">${pageNumber}</font>
								</c:when>
								<c:otherwise>
									<a href="${pageUrl}">${pageNumber}</a>
								</c:otherwise>
							</c:choose>
						</pg:pages>
						<pg:next>
							<a href="${pageUrl}">后一页</a>
						</pg:next>
						<pg:last>
							<a href="${pageUrl}">[尾页]</a>
						</pg:last>
					</pg:pager>
				</div>

			</div>

		</div>

	</body>
</html>